home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- ** ArgParseTest
- ******************************************************************************/
-
- OPTIONS RESULTS
-
- PARSE ARG cmdline
-
- NL = '0a'x
- ESC= '1b'x /* escape code */
-
- template="ACTION/A,DRIVE/A,FILE/A,TRACKS/K,KEYTWO/K,COLSTART/N,VERBOSE/S,FORCE/S"
-
- st=TIME('E')
- ap=ArgParse(template,cmdline)
- et=TIME('E')
- IF DATATYPE(ap,'W') == 1 THEN /* parsing error occured */
- SIGNAL CLEANUP
- INTERPRET ap
-
- ap2 = TRANSLATE(" " || ap,NL,";")
- say "ArgParse returned «" || esc || "[33m" || ap || esc || "[0m»"
- say "Executing:"
- say esc || "[33m" || ap2 || esc || "[0m"
-
- CLEANUP:
- say
- say "ArgParse took " || et-st || " seconds"
- say "ArgParseTest took " || TIME('E')-st || " seconds"
- say
-
-